/**
 * DictionaryService.java
 * Version 1.0.0
 * Created on 2018年7月23日
 *
 */
package com.yincheng.oes.business.util.dictionary;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author yangsy
 * @version 1.0.0
 * @since
 * 创建时间：2018年7月23日
 * <p>
 * 功能描述：
 * <p>
 * 邮箱地址：446948434@qq.com
 */
@Service
public class DictionaryService {

    @Autowired
    private DictionaryMapper dictionaryMapper;

    public List<Dictionary> getByModel(String model) {
        List<Dictionary> list = dictionaryMapper.selectByModel(model);
        return list;
    }

    public Dictionary getByModelAndCode(String model, String code) {
        Dictionary dictionary = dictionaryMapper.selectDicByModelAndCode(model, code);
        return dictionary;
    }

    public List<Dictionary> getByPId(Integer pid) {
        List<Dictionary> list = dictionaryMapper.selectByPId(pid);
        return list;
    }

    public List<Dictionary> getChildrenByModelAndCode(String model, String code) {
        List<Dictionary> list = dictionaryMapper.selectChildrenByModelAndCode(model, code);
        return list;
    }
}
